<div class="page_basic">
  <%= render("_nav.html", assigns) %>

  <%= form_for @changeset, Routes.home_path(@conn, :update), [class: "form", multipart: true], fn f -> %>
    <input type="hidden" name="from" value="account">

    <div class="form-element_wrap">
      <div class="form-element <%= PublicHelpers.error_class(f, :email) %>">
        <label>Email</label>
        <%= text_input(f, :email) %>
        <%= PublicHelpers.error_message(f, :email) %>
      </div>
    </div>

    <%= inputs_for f, :settings, fn i -> %>
    <div class="form-checklist">
      <label>Email Settings</label>

      <div class="form-checklist-item <%= PublicHelpers.error_class(f, :email_on_submitted_news) %>">
        <label>
          <%= checkbox(i, :email_on_submitted_news) %>
          <span class="form-checklist-item-box"></span>
          <span class="form-checklist-item-text">Email when something I submit gets featured in Changelog News</span>
        </label>
      </div>

      <div class="form-checklist-item <%= PublicHelpers.error_class(f, :email_on_authored_news) %>">
        <label>
          <%= checkbox(i, :email_on_authored_news) %>
          <span class="form-checklist-item-box"></span>
          <span class="form-checklist-item-text">Email when something I authored gets featured in Changelog News</span>
        </label>
      </div>

      <div class="form-checklist-item <%= PublicHelpers.error_class(f, :email_on_comment_replies) %>">
        <label>
          <%= checkbox(i, :email_on_comment_replies) %>
          <span class="form-checklist-item-box"></span>
          <span class="form-checklist-item-text">Email when someone replies to one of my comments</span>
        </label>
      </div>

      <div class="form-checklist-item <%= PublicHelpers.error_class(f, :email_on_comment_mentions) %>">
        <label>
          <%= checkbox(i, :email_on_comment_mentions) %>
          <span class="form-checklist-item-box"></span>
          <span class="form-checklist-item-text">Email when someone mentions me in discussions</span>
        </label>
      </div>
    </div>

    <div class="form-checklist">
      <label>Subscription Settings</label>

      <div class="form-checklist-item <%= PublicHelpers.error_class(f, :subscribe_to_contributed_news) %>">
        <label>
          <%= checkbox(i, :subscribe_to_contributed_news) %>
          <span class="form-checklist-item-box"></span>
          <span class="form-checklist-item-text">Auto-subscribe to discussions on news I contribute to</span>
        </label>
      </div>

      <div class="form-checklist-item <%= PublicHelpers.error_class(f, :subscribe_to_participated_episodes) %>">
        <label>
          <%= checkbox(i, :subscribe_to_participated_episodes) %>
          <span class="form-checklist-item-box"></span>
          <span class="form-checklist-item-text">Auto-subscribe to discussions on episodes I'm on</span>
        </label>
      </div>
    </div>
    <% end %>

    <div class="form-submit">
      <p class="form-submit-toc"></p>
      <div>
        <input type="submit" value="Save">
        <div class="form_submit_responses"></div>
      </div>
    </div>
  <% end %>
</div>
